file(GLOB_RECURSE SOURCES *.cc *.cpp)
file(GLOB_RECURSE HEADERS *.h)

foreach(def ${wxWidgets_DEFINITIONS})
  add_definitions(
    -D${def}
  )
endforeach()
add_definitions(
  -DSCI_LEXER -DLINK_LEXERS
)

add_library(wxcommon STATIC
  ${SOURCES} ${HEADERS}
)

target_include_directories(wxcommon
  PUBLIC
		${CMAKE_CURRENT_SOURCE_DIR}
    ${wxWidgets_INCLUDE_DIRS}
    ${GTK2_INCLUDE_DIRS}
)

target_link_libraries(wxcommon
  PUBLIC
    Szarp2
    ${OpenSSL_LIBRARIES}
  INTERFACE
    ${wxWidgets_LIBRARIES}
    ${GTK2_LIBRARIES}
    ${OPENSSL_LIBRARIES}
)

add_custom_target( common_pl ALL msgfmt --output-file=pl/common.mo pl/common.po )
install(FILES pl/common.mo DESTINATION "${SZARP_SHAREDIR}/locales/pl_PL/LC_MESSAGES/" )

add_custom_target( wx_pl ALL msgfmt --output-file=pl/wx.mo pl/wx.po )
install(FILES pl/wx.mo DESTINATION "${SZARP_SHAREDIR}/locales/pl_PL/LC_MESSAGES/" )
